<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>英语口语练习 - 语言学习中心</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#8B5CF6',
                        dark: '#1E293B',
                        light: '#F8FAFC'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .level-indicator {
                height: 8px;
                border-radius: 4px;
                transition: width 1s ease-in-out;
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-5px);
            }
        }
    </style>
</head>
<body class="bg-light text-dark min-h-screen flex flex-col">
<!-- 导航栏 -->
<nav id="navbar" class="fixed w-full bg-white/90 backdrop-blur-sm shadow-sm z-50 transition-all duration-300">
    <div class="container mx-auto px-4 py-3 flex justify-between items-center">
        <a href="index.html" class="flex items-center space-x-2">
            <i class="fa fa-comments text-primary text-2xl"></i>
            <span class="font-bold text-xl text-primary">语言学习中心</span>
        </a>

        <!-- 桌面导航 -->
        <div class="hidden md:flex items-center space-x-8">
            <a href="index.html" class="font-medium text-gray-600 hover:text-primary transition-colors py-1">首页</a>
            <a href="random.html" class="font-medium text-gray-600 hover:text-primary transition-colors py-1">随便体验</a>
            <a href="english.html" class="font-medium text-primary border-b-2 border-primary py-1">英语口语练习</a>
            <a href="history.html" class="font-medium text-gray-600 hover:text-primary transition-colors py-1">历史场景对话</a>
        </div>

        <!-- 移动端菜单按钮 -->
        <button id="menu-toggle" class="md:hidden text-gray-600 focus:outline-none">
            <i class="fa fa-bars text-xl"></i>
        </button>
    </div>

    <!-- 移动端导航菜单 -->
    <div id="mobile-menu" class="md:hidden hidden bg-white border-t">
        <div class="container mx-auto px-4 py-2 flex flex-col space-y-3">
            <a href="index.html" class="font-medium text-gray-600 hover:text-primary transition-colors py-2">首页</a>
            <a href="random.html" class="font-medium text-gray-600 hover:text-primary transition-colors py-2">随便体验</a>
            <a href="english.html" class="font-medium text-primary py-2">英语口语练习</a>
            <a href="history.html" class="font-medium text-gray-600 hover:text-primary transition-colors py-2">历史场景对话</a>
        </div>
    </div>
</nav>

<!-- 主要内容 -->
<main class="flex-grow pt-16">
    <!-- 页面标题 -->
    <section class="bg-gradient-to-r from-green-400 to-teal-500 text-white py-16 md:py-24">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row items-center justify-between">
                <div>
                    <h1 class="text-[clamp(1.8rem,4vw,3rem)] font-bold mb-4 text-shadow">英语口语练习</h1>
                    <p class="text-white/90 text-lg max-w-2xl">专注于提升英语口语能力，模拟真实交流场景，锻炼听说技能</p>
                </div>
                <a href="index.html" class="mt-6 md:mt-0 bg-white text-secondary hover:bg-gray-100 font-medium px-6 py-3 rounded-lg shadow-md transition-all">
                    <i class="fa fa-home mr-2"></i> 返回首页
                </a>
            </div>
        </div>
    </section>

    <!-- 练习内容区 -->
    <section class="py-16">
        <div class="container mx-auto px-4">
            <div class="max-w-5xl mx-auto">
                <!-- 水平选项卡 -->
                <div class="mb-8 border-b border-gray-200">
                    <div class="flex overflow-x-auto md:overflow-visible space-x-8">
                        <button class="py-4 px-1 border-b-2 border-secondary text-secondary font-medium whitespace-nowrap">
                            日常对话
                        </button>
                        <button class="py-4 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 font-medium whitespace-nowrap">
                            商务英语
                        </button>
                        <button class="py-4 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 font-medium whitespace-nowrap">
                            旅游英语
                        </button>
                        <button class="py-4 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 font-medium whitespace-nowrap">
                            学术英语
                        </button>
                        <button class="py-4 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 font-medium whitespace-nowrap">
                            考试准备
                        </button>
                    </div>
                </div>

                <!-- 难度选择 -->
                <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                    <h2 class="text-xl font-bold mb-4">选择难度级别</h2>
                    <div class="grid grid-cols-3 gap-4">
                        <button class="difficulty-btn py-4 px-2 border-2 border-gray-200 rounded-lg hover:border-secondary/50 transition-colors">
                            <div class="text-center">
                                <div class="text-gray-400 mb-2">
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star-o"></i>
                                </div>
                                <span class="font-medium">初级</span>
                            </div>
                        </button>
                        <button class="difficulty-btn py-4 px-2 border-2 border-secondary rounded-lg bg-secondary/5">
                            <div class="text-center">
                                <div class="text-secondary mb-2">
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star-o"></i>
                                </div>
                                <span class="font-medium text-secondary">中级</span>
                            </div>
                        </button>
                        <button class="difficulty-btn py-4 px-2 border-2 border-gray-200 rounded-lg hover:border-secondary/50 transition-colors">
                            <div class="text-center">
                                <div class="text-gray-400 mb-2">
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                </div>
                                <span class="font-medium">高级</span>
                            </div>
                        </button>
                    </div>
                </div>

                <!-- 练习场景 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                    <div class="bg-gradient-to-r from-green-400 to-teal-500 text-white p-4">
                        <div class="flex justify-between items-center">
                            <h3 class="font-bold text-lg">练习：在餐厅点餐</h3>
                            <div class="flex items-center text-sm">
                                <i class="fa fa-clock-o mr-1"></i> 预计时间: 10分钟
                            </div>
                        </div>
                    </div>

                    <div class="p-6">
                        <!-- 练习说明 -->
                        <div class="bg-gray-50 p-4 rounded-lg mb-6">
                            <h4 class="font-bold mb-2 flex items-center">
                                <i class="fa fa-info-circle text-secondary mr-2"></i> 练习说明
                            </h4>
                            <p class="text-gray-600 mb-2">在这个练习中，你将模拟在西餐厅点餐的场景。请根据服务员的提问，选择合适的英语表达进行回应。</p>
                            <p class="text-gray-600">完成后，系统会对你的发音和语法进行评分，并提供改进建议。</p>
                        </div>

                        <!-- 对话区域 -->
                        <div class="space-y-6 mb-8" id="exercise-conversation">
                            <div class="flex items-start space-x-4">
                                <div class="w-12 h-12 rounded-full bg-gray-300 flex-shrink-0 overflow-hidden">
                                    <img src="https://picsum.photos/id/1005/100/100" alt="服务员头像" class="w-full h-full object-cover">
                                </div>
                                <div class="bg-gray-100 rounded-lg rounded-tl-none px-4 py-3 max-w-[80%]">
                                    <p class="text-gray-800 mb-2"><strong>Waiter:</strong> Good evening! Do you have a reservation?</p>
                                    <p class="text-gray-500 text-sm italic">晚上好！请问您有预订吗？</p>
                                </div>
                            </div>

                            <div class="flex items-start space-x-4 justify-end">
                                <div class="bg-secondary text-white rounded-lg rounded-tr-none px-4 py-3 max-w-[80%]">
                                    <p class="mb-2"><strong>You:</strong> No, we don't. Can we get a table for two, please?</p>
                                    <p class="text-white/80 text-sm italic">没有，我们能要一张两人桌吗？</p>
                                </div>
                                <div class="w-12 h-12 rounded-full bg-gray-300 flex-shrink-0 overflow-hidden">
                                    <img src="https://picsum.photos/id/1012/100/100" alt="你的头像" class="w-full h-full object-cover">
                                </div>
                            </div>

                            <div class="flex items-start space-x-4">
                                <div class="w-12 h-12 rounded-full bg-gray-300 flex-shrink-0 overflow-hidden">
                                    <img src="https://picsum.photos/id/1005/100/100" alt="服务员头像" class="w-full h-full object-cover">
                                </div>
                                <div class="bg-gray-100 rounded-lg rounded-tl-none px-4 py-3 max-w-[80%]">
                                    <p class="text-gray-800 mb-2"><strong>Waiter:</strong> Sure, right this way. Here's the menu. Would you like something to drink while you decide?</p>
                                    <p class="text-gray-500 text-sm italic">当然可以，请这边走。这是菜单。在您决定点什么的时候，需要喝点什么吗？</p>
                                </div>
                            </div>
                        </div>

                        <!-- 回答选项 -->
                        <div class="border-t pt-6 mb-6">
                            <h4 class="font-bold mb-4">请选择合适的回答：</h4>
                            <div class="space-y-3">
                                <div class="answer-option p-4 border border-gray-200 rounded-lg hover:border-secondary hover:bg-secondary/5 cursor-pointer transition-colors">
                                    <p class="font-medium">A. I want coffee.</p>
                                    <p class="text-gray-600 text-sm">我想要咖啡。</p>
                                </div>
                                <div class="answer-option p-4 border border-secondary bg-secondary/5 rounded-lg cursor-pointer transition-colors">
                                    <p class="font-medium text-secondary">B. Yes, we'll have two glasses of water, please.</p>
                                    <p class="text-gray-600 text-sm">是的，请给我们两杯 water。</p>
                                </div>
                                <div class="answer-option p-4 border border-gray-200 rounded-lg hover:border-secondary hover:bg-secondary/5 cursor-pointer transition-colors">
                                    <p class="font-medium">C. No, we are in a hurry.</p>
                                    <p class="text-gray-600 text-sm">不，我们很着急。</p>
                                </div>
                                <div class="answer-option p-4 border border-gray-200 rounded-lg hover:border-secondary hover:bg-secondary/5 cursor-pointer transition-colors">
                                    <p class="font-medium">D. What do you recommend?</p>
                                    <p class="text-gray-600 text-sm">你推荐什么？</p>
                                </div>
                            </div>
                        </div>

                        <!-- 录音区域 -->
                        <div class="border-t pt-6">
                            <h4 class="font-bold mb-4">尝试自己说（点击麦克风录音）：</h4>
                            <div class="flex flex-col md:flex-row items-center gap-4">
                                <button id="record-btn" class="bg-secondary hover:bg-secondary/90 text-white w-16 h-16 rounded-full flex items-center justify-center shadow-md transition-all">
                                    <i class="fa fa-microphone text-2xl"></i>
                                </button>
                                <div class="flex-grow bg-gray-50 p-4 rounded-lg w-full">
                                    <div class="flex justify-between items-center mb-2">
                                        <span class="text-sm text-gray-500">录音将在这里显示...</span>
                                        <span class="text-sm text-gray-500">00:00</span>
                                    </div>
                                    <div class="w-full bg-gray-200 rounded-full h-1.5">
                                        <div class="bg-secondary level-indicator w-0"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 操作按钮 -->
                <div class="flex flex-wrap gap-4 justify-center">
                    <button class="bg-secondary hover:bg-secondary/90 text-white font-medium px-6 py-3 rounded-lg shadow-md transition-all transform hover:-translate-y-1 flex items-center">
                        <i class="fa fa-check mr-2"></i> 提交答案
                    </button>
                    <button class="bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium px-6 py-3 rounded-lg transition-all flex items-center">
                        <i class="fa fa-step-backward mr-2"></i> 上一题
                    </button>
                    <button class="bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium px-6 py-3 rounded-lg transition-all flex items-center">
                        下一题 <i class="fa fa-step-forward ml-2"></i>
                    </button>
                </div>
            </div>
        </div>
    </section>

    <!-- 学习进度 -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto px-4">
            <h2 class="text-2xl font-bold mb-2 text-center">你的学习进度</h2>
            <p class="text-gray-600 text-center mb-12 max-w-2xl mx-auto">跟踪你的学习情况，了解自己的进步和需要加强的方面</p>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-5xl mx-auto">
                <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                    <div class="flex justify-between items-start mb-4">
                        <div>
                            <h3 class="text-gray-500 font-medium">总练习次数</h3>
                            <p class="text-3xl font-bold mt-1">24</p>
                        </div>
                        <div class="w-10 h-10 rounded-full bg-secondary/10 flex items-center justify-center">
                            <i class="fa fa-calendar-check-o text-secondary"></i>
                        </div>
                    </div>
                    <div class="text-sm text-green-600 flex items-center">
                        <i class="fa fa-arrow-up mr-1"></i> 较上周增长 12%
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                    <div class="flex justify-between items-start mb-4">
                        <div>
                            <h3 class="text-gray-500 font-medium">平均得分</h3>
                            <p class="text-3xl font-bold mt-1">82</p>
                        </div>
                        <div class="w-10 h-10 rounded-full bg-yellow-100 flex items-center justify-center">
                            <i class="fa fa-star text-yellow-500"></i>
                        </div>
                    </div>
                    <div class="text-sm text-green-600 flex items-center">
                        <i class="fa fa-arrow-up mr-1"></i> 较上周增长 5%
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                    <div class="flex justify-between items-start mb-4">
                        <div>
                            <h3 class="text-gray-500 font-medium">学习时长</h3>
                            <p class="text-3xl font-bold mt-1">5.2h</p>
                        </div>
                        <div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center">
                            <i class="fa fa-clock-o text-primary"></i>
                        </div>
                    </div>
                    <div class="text-sm text-red-600 flex items-center">
                        <i class="fa fa-arrow-down mr-1"></i> 较上周减少 3%
                    </div>
                </div>

                <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                    <div class="flex justify-between items-start mb-4">
                        <div>
                            <h3 class="text-gray-500 font-medium">掌握词汇</h3>
                            <p class="text-3xl font-bold mt-1">187</p>
                        </div>
                        <div class="w-10 h-10 rounded-full bg-accent/10 flex items-center justify-center">
                            <i class="fa fa-book text-accent"></i>
                        </div>
                    </div>
                    <div class="text-sm text-green-600 flex items-center">
                        <i class="fa fa-arrow-up mr-1"></i> 较上周增长 8%
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<!-- 页脚 -->
<footer class="bg-dark text-white py-12">
    <div class="container mx-auto px-4">
        <div class="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
            <div>
                <div class="flex items-center space-x-2 mb-4">
                    <i class="fa fa-comments text-primary text-xl"></i>
                    <span class="font-bold text-lg">语言学习中心</span>
                </div>
                <p class="text-gray-400 mb-4">让语言学习变得更有趣、更高效</p>
                <div class="flex space-x-4">
                    <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                        <i class="fa fa-facebook"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                        <i class="fa fa-twitter"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                        <i class="fa fa-instagram"></i>
                    </a>
                    <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                        <i class="fa fa-youtube"></i>
                    </a>
                </div>
            </div>

            <div>
                <h4 class="font-bold text-lg mb-4">快速链接</h4>
                <ul class="space-y-2">
                    <li><a href="index.html" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
                    <li><a href="random.html" class="text-gray-400 hover:text-white transition-colors">随便体验</a></li>
                    <li><a href="english.html" class="text-gray-400 hover:text-white transition-colors">英语口语练习</a></li>
                    <li><a href="history.html" class="text-gray-400 hover:text-white transition-colors">历史场景对话</a></li>
                </ul>
            </div>

            <div>
                <h4 class="font-bold text-lg mb-4">支持</h4>
                <ul class="space-y-2">
                    <li><a href="#" class="text-gray-400 hover:text-white transition-colors">帮助中心</a></li>
                    <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
                    <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
                </ul>
            </div>

            <div>
                <h4 class="font-bold text-lg mb-4">订阅更新</h4>
                <p class="text-gray-400 mb-4">获取最新的学习资源和技巧</p>
                <form class="flex">
                    <input type="email" placeholder="你的邮箱地址" class="px-4 py-2 rounded-l-lg w-full focus:outline-none text-dark">
                    <button type="submit" class="bg-primary hover:bg-primary/90 px-4 py-2 rounded-r-lg transition-colors">
                        <i class="fa fa-paper-plane"></i>
                    </button>
                </form>
            </div>
        </div>

        <div class="border-t border-gray-800 pt-8 text-center text-gray-500">
            <p>&copy; 2023 语言学习中心. 保留所有权利.</p>
        </div>
    </div>
</footer>

<script>
    // 移动端菜单切换
    const menuToggle = document.getElementById('menu-toggle');
    const mobileMenu = document.getElementById('mobile-menu');

    menuToggle.addEventListener('click', () => {
        mobileMenu.classList.toggle('hidden');
    });

    // 导航栏滚动效果
    const navbar = document.getElementById('navbar');

    window.addEventListener('scroll', () => {
        if (window.scrollY > 50) {
            navbar.classList.add('py-2', 'shadow');
            navbar.classList.remove('py-3');
        } else {
            navbar.classList.add('py-3');
            navbar.classList.remove('py-2', 'shadow');
        }
    });

    // 难度选择按钮交互
    const difficultyBtns = document.querySelectorAll('.difficulty-btn');
    difficultyBtns.forEach(btn => {
        btn.addEventListener('click', () => {
            // 移除所有按钮的active状态
            difficultyBtns.forEach(b => {
                b.classList.remove('border-secondary', 'bg-secondary/5');
                b.classList.add('border-gray-200');

                // 重置星级颜色
                const stars = b.querySelectorAll('.fa');
                stars.forEach(star => {
                    star.classList.remove('text-secondary');
                    star.classList.add('text-gray-400');
                });

                // 重置文字颜色
                const text = b.querySelector('span');
                text.classList.remove('text-secondary');
            });

            // 添加当前按钮的active状态
            btn.classList.remove('border-gray-200');
            btn.classList.add('border-secondary', 'bg-secondary/5');

            // 设置星级颜色
            const stars = btn.querySelectorAll('.fa');
            stars.forEach(star => {
                if (star.classList.contains('fa-star')) {
                    star.classList.remove('text-gray-400');
                    star.classList.add('text-secondary');
                }
            });

            // 设置文字颜色
            const text = btn.querySelector('span');
            text.classList.add('text-secondary');
        });
    });

    // 回答选项交互
    const answerOptions = document.querySelectorAll('.answer-option');
    answerOptions.forEach(option => {
        option.addEventListener('click', () => {
            // 移除所有选项的选中状态
            answerOptions.forEach(opt => {
                opt.classList.remove('border-secondary', 'bg-secondary/5');
                opt.classList.add('border-gray-200');

                // 重置文字颜色
                const text = opt.querySelector('p:first-child');
                text.classList.remove('text-secondary');
            });

            // 添加当前选项的选中状态
            option.classList.remove('border-gray-200');
            option.classList.add('border-secondary', 'bg-secondary/5');

            // 设置文字颜色
            const text = option.querySelector('p:first-child');
            text.classList.add('text-secondary');
        });
    });

    // 录音按钮交互
    const recordBtn = document.getElementById('record-btn');
    let isRecording = false;
    const levelIndicator = document.querySelector('.level-indicator');

    recordBtn.addEventListener('click', () => {
        isRecording = !isRecording;

        if (isRecording) {
            // 开始录音
            recordBtn.innerHTML = '<i class="fa fa-stop text-2xl"></i>';
            recordBtn.classList.remove('bg-secondary');
            recordBtn.classList.add('bg-red-500');

            // 模拟音量变化动画
            simulateAudioLevel();
        } else {
            // 停止录音
            recordBtn.innerHTML = '<i class="fa fa-microphone text-2xl"></i>';
            recordBtn.classList.remove('bg-red-500');
            recordBtn.classList.add('bg-secondary');

            // 停止音量动画
            stopAudioSimulation();
        }
    });

    let audioSimulationInterval;

    function simulateAudioLevel() {
        audioSimulationInterval = setInterval(() => {
            // 随机生成音量级别 (30% - 80%)
            const level = Math.floor(Math.random() * 50) + 30;
            levelIndicator.style.width = `${level}%`;
        }, 300);
    }

    function stopAudioSimulation() {
        clearInterval(audioSimulationInterval);
        levelIndicator.style.width = '0%';
    }
</script>
</body>
</html>
